﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="admin_Finan_list.aspx.cs" Inherits="Web.admin_Finan_list" %>

<%@ Register Assembly="Control" Namespace="Com.Control" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>出入列表</title>
    <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="js/jquery.js"></script>
 
  <meta http-equiv="refresh" content="1800; url=admin_Finan_list.aspx" />
    <link href="css/CodeProject.css" rel="stylesheet" type="text/css" />
    <link href="css/Page.css" rel="stylesheet" type="text/css" />
      <script type="text/javascript">
        $(document).ready(init);
        function init() {

            $('#selectAll').click(function() {
                var is_selected = ($('#selectAll').attr("checked") == true) ? true : false;

                $("input[@name='tablechoice[]']").each(function() {
                    $(this).attr("checked", is_selected);
                });

            })

        }    
        
        
          function batchPrint() {

              var str_url = "";
              var str_task_id = "";
              $("input[@name='tablechoice[]']").each(function() {
              if ($(this).attr("checked") == true) {
                      if($(this).val() != "on")
                        str_task_id = str_task_id + $(this).val() + ",";
                  }
              });

              if (str_task_id != "") {
                  str_task_id = str_task_id.substr(0, str_task_id.length - 1);
                  window.open("admin_printall.aspx?url=" + str_task_id);
              }
              else {
                  alert("请选择订单!");
              }
          
          }      
    </script>
    
    
    <script type="text/javascript">
        $(document).ready(function() {
            var selects = $("#select");
            var options = $("#option");
            var state = true;
            selects.click(function() {
                if (state) {
                    if (!($(this).is(":animated"))) {
                        options.slideDown();
                    } else {
                        options.css("display", "none");
                    }
                    state = false;
                } else {
                    if (!($(this).is(":animated"))) {
                        options.slideUp();
                    } else {
                        $(this).stop(true, true);
                        options.css("display", "");
                    }
                    state = true;
                }
            });
            selects.hover(function() {
            $(this).css("background", "url(images/selectbg2.jpg) right 0px no-repeat");
            },
function() {
            $(this).css("background", "url(images/selectbg.jpg) right 0px no-repeat");
});
            $("li").hover(function() {
                $(this).css("background", "#990000").css("color", "#ff9900");
            },
function() {
    $(this).css("background", "#820014").css("color", "#fff");
});
            $("li").click(function() {
                $(this).css("background", "#c00").css("color", "#ffffff");
                options.css("display", "none");
                selects.children("span").text($(this).attr("tip"));
                $(".valt").val($(this).attr("tip"));
                state = false;
            });
            options.click(function() {
                selects.click(function() { return false; });
            });
        })
</script>
    
    
    <script type="text/javascript">
function chkAll_true()
{
	var chkall= document.getElementById("chkAll");
	var j=0;
	var chkother= document.getElementsByTagName("input");
	
	for (var i=0;i<chkother.length;i++)
	{
		if( chkother[i].type=='checkbox')
		{
			if(chkother[i].id.indexOf('chksigle')>-1)
			{
				if(chkall.checked==true)
				{
					chkother[i].checked=true;
				}
				else
				{
					chkother[i].checked=false;
				}
			}
		}
	}
}
</script>

<style type="text/css">

.select{width:45px;height:24px;line-height:24px;position:relative;text-align:center;cursor:pointer;background:url(images/selectbg.jpg) right 0px no-repeat;color:#fff;}
.option{line-height:24px;width:45px;position:absolute;top:24px;left:0px;display:none;background:#820014;}
ul{list-style:none;margin:0;padding:0;}
ul li{height:24px;background:#666px;text-align:center;}
</style>


</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="border: 1px solid #9abddd;" border="0" cellpadding="0"
            cellspacing="0" width="98%">
            <tr>
                <td class="TitleBar" colspan="14" align="center">
                    记账管理
                </td>
            </tr>
            <tr>
                <td class="Pager" colspan="14" style="padding-right: 30px; text-align:left; ">
                
                         &nbsp;  &nbsp; 账 &nbsp; 户：
                     <asp:DropDownList ID="ddlBankType" runat="server" TabIndex="5"  >
                    </asp:DropDownList>
                           &nbsp; &nbsp;  部&nbsp;&nbsp;门：
                     <asp:DropDownList ID="ddldepartType" runat="server" TabIndex="6"  >
                    </asp:DropDownList>
                           
                    &nbsp;&nbsp;
                     费用类型：
                    <asp:DropDownList ID="ddlStatus" runat="server" TabIndex="3" >
                     <asp:ListItem Value="-1" Selected="True" >请选择</asp:ListItem>
                    <asp:ListItem Value="1" >现金日记账</asp:ListItem>
                      <asp:ListItem Value="2" >银行日记账</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;&nbsp;项目分类：
                     <asp:DropDownList ID="ddlItemType" runat="server" TabIndex="4"  >
                    </asp:DropDownList>
                  
                    
                </td>
                
            </tr>
            
            <tr>
             <td class="Pager" colspan="14" style="padding-right: 30px; text-align:left; ">
             
             &nbsp;&nbsp;
               <asp:Label ID="lblName" runat="server" Text="操作人："></asp:Label>   &nbsp;
                      <asp:DropDownList ID="ddlDoPeper" runat="server" TabIndex="8" Width="130px" >
                    </asp:DropDownList>
                    &nbsp; 进入账：
                     <asp:DropDownList ID="ddlAmountType" runat="server" TabIndex="7" Width="115px" >
                    </asp:DropDownList>
                       &nbsp;&nbsp;
               开始时间：&nbsp;&nbsp;<asp:TextBox ID="BeginDataTime" runat="server" onclick="new WdatePicker({dateFmt:'yyyy-MM-dd'});"  TabIndex="10" Width="85px"></asp:TextBox>
               &nbsp;&nbsp;
                    结束时间：&nbsp;&nbsp;<asp:TextBox ID="EndDataTime" runat="server" onclick="new WdatePicker({dateFmt:'yyyy-MM-dd'});"  TabIndex="11"></asp:TextBox>
                  
                    
                </td>
            
              </tr>
            
             <tr>
                <td class="Pager" colspan="5" style="padding-right: 40px; text-align:left; ">
                  &nbsp; &nbsp; &nbsp; &nbsp;
                    
                         <asp:Button runat="server" ID="btn_add" Text="添加凭证" onclick="btn_add_Click" Width="80px"   />
                   <%-- <asp:Button ID="btn_print" runat="server" onclick="btn_print_Click" Text="多条打印" />--%>
                    <input type="button" id="btBatchPrint" value="打印" onclick="batchPrint()"  Width="80px" />
                    <asp:Button ID="btn_fresh" runat="server" Text="刷新" onclick="btn_fresh_Click" Width="40px" />
                    
                   
                </td>
                <td class="Pager" colspan="4" >
                 <%=PageMessage %> &nbsp;
                </td>
                 <td class="Pager" colspan="5" style="padding-right: 10px; text-align:right; ">
                 <asp:Button runat="server" ID="btn_ok" Text="查询" OnClick="btn_ok_Click"  Width="100px"   style=" margin-right:30px;" />
                    <asp:Button runat="server" ID="Button2" Text="导出"  Width="100px" 
                         onclick="btn_output_Click" />
                  
                </td>
            </tr>
            
            
                 <tr>
            
                  <td class="RecordItem"  style=" text-align:center; ">
                    现金总收入
                </td>
                  <td class="RecordItem"  style=" text-align:center;   " colspan="2" >
                <span style="color:#cd0000;"> <%=All_Income.ToString("#,##0.00")%></span>
                </td>
                
                 <td class="RecordItem"  style=" text-align:center; ">
                    银行总收入
                </td>
                  <td class="RecordItem"  style=" text-align:left;  padding-left:20px; " colspan="2">
                  <span style="color:#cd0000;">  <%=Bank_All_Income.ToString("#,##0.00")%></span>
                </td>
                
                   <td class="RecordItem"  style=" text-align:center; ">
                   本月现金收入
                </td>
                  <td class="RecordItem"  style=" text-align:center; " colspan="2" >
                  <span style="color:#cd0000;">  <%=cash_Income.ToString("#,##0.00")%></span>
                </td>
                  <td class="RecordItem"  style=" text-align:center; ">
                    本月银行收入
                </td>
                  <td class="RecordItem"  style=" text-align:left;  padding-left:20px; " colspan="4" >
                  <span style="color:#cd0000;">  <%=day_Income.ToString("#,##0.00")%></span>
                </td>
                
                
            </tr>
            
            <tr>
            
                   <td class="RecordItem" style=" text-align:center; ">
                   现金总支出
                </td>
                   <td class="RecordItem" style=" text-align:center; " colspan="2">
                  <span style=" color:Blue;"> <%=ALL_Outcome.ToString("#,##0.00")%></span>
                </td>
                
                
                 <td class="RecordItem" style=" text-align:center; ">
                    银行总支出
                </td>
                   <td class="RecordItem" style=" text-align:left;  padding-left:20px; " colspan="2">
                   <span style=" color:Blue;"> <%=Bank_All_Outcome.ToString("#,##0.00")%></span>
                </td>
                
                  <td class="RecordItem" style=" text-align:center; ">
                   本月现金支出
                </td>
                   <td class="RecordItem" style=" text-align:center; "  colspan="2">
                   <span style=" color:Blue;"> <%=cash_Outcome.ToString("#,##0.00")%></span>
                </td>
                 <td class="RecordItem" style=" text-align:center; ">
                    本月银行支出
                </td>
                   <td class="RecordItem" style=" text-align:left;  padding-left:20px; "  colspan="4">
                   <span style=" color:Blue;"> <%=day_Outcome.ToString("#,##0.00")%></span>
                </td>
               
            </tr>
             <tr>
             
                 <td class="RecordItem" style=" text-align:center;border-bottom:1px solid #767676;  ">
                    现金总余额
                </td>
                 <td class="RecordItem" style=" text-align:center; border-bottom:1px solid #767676; " colspan="2">
                   
                     <%=All_Sumcome.ToString("#,##0.00") %>
                </td>
                
                  <td class="RecordItem" style=" text-align:center;border-bottom:1px solid #767676;  ">
                  银行总余额
                </td>
                 <td class="RecordItem" style=" text-align:left; border-bottom:1px solid #767676;  padding-left:20px; " colspan="2">
                 <%=Bank_All_Sumcome.ToString("#,##0.00")%>
                </td>
                
                
                <td class="RecordItem" style=" text-align:center;border-bottom:1px solid #767676;  ">
                  本月现金余额
                </td>
                 <td class="RecordItem" style=" text-align:center; border-bottom:1px solid #767676;  " colspan="2">
                    
                     <%=cash_Sumcome.ToString("#,##0.00") %>
                </td>
                <td class="RecordItem" style=" text-align:center;border-bottom:1px solid #767676;  ">
                  本月银行余额
                </td>
                 <td class="RecordItem" style=" text-align:left;  padding-left:20px;border-bottom:1px solid #767676;  "  colspan="4">
                   
                    <%=day_Sumcome.ToString("#,##0.00") %>
                </td>
                
            </tr>
                <tr style=" height:8px;">
                
            </tr>
            <tr> 
            <td class="MenuItem"  style=" text-align:center; " rowspan="2" >
                  <input id="selectAll" type="checkbox" name="tablechoice[]" /><br />全选
                </td>
                <td class="MenuItem"  style=" text-align:center;"  rowspan="2" >
                    凭证号
                </td>
            <td class="MenuItem"  style=" text-align:center; width:70px;" rowspan="2">
                    日期
                </td>
            <td class="MenuItem" style=" text-align:center;" rowspan="2">
                    费用类型
                </td>
                 <td class="MenuItem" style=" text-align:center; width:200px;" rowspan="2">
                  摘要
                </td>
                <td class="MenuItem" style=" text-align:center;" rowspan="2">
                    项目分类
                </td>
                 <td class="MenuItem" style=" text-align:center;" rowspan="2">
                    部门
                </td>
                 <td class="MenuItem" style=" text-align:center;" rowspan="2">
                   借(收)
                </td>
                 <td class="MenuItem" style=" text-align:center;" rowspan="2">
                  贷(支)
                </td>
                   <td class="MenuItem" style=" text-align:center;">
                  余额
                </td>
                  <td class="MenuItem" style=" text-align:center;" rowspan="2">
                操作人
                </td>
                   <td class="MenuItem" style=" text-align:center;" rowspan="2">
                审核人
                </td>
                    <td class="MenuItem" style=" text-align:center;" rowspan="2">
                受款人
                </td>
                
                
               
                <td class="MenuItemRight" style=" text-align:center;" rowspan="2">
                    操作
                </td>
            </tr>
             <tr> 
                <td class="MenuItem" style=" text-align:center;">
                <span style=" font-size:10px; color:#cd0000;">上月节余</span>
                   <%=lastBlance.ToString("#,##0.00")%>
                </td>
                     
                
            </tr>
            <asp:Repeater ID="repeater" runat="server" onitemcommand="repeater_ItemCommand">
                <ItemTemplate>
                    <tr style='background-color:<%#(Container.ItemIndex%2==0)?"write":"#f5f5f5;"%>'>
                    <td class="RecordItem" style=" text-align:center;  ">
                  
                  <input value='<%#Eval("Id")%>' title="c_<%#Eval("Id")%>" type="checkbox" name="tablechoice[]"  />
                    </td>
                     <td class="RecordItem"     style="  text-align:center; ">
                         <%#(int)Eval("AmountType") == 1 ? "S" + Eval("RNum").ToString().PadLeft(8, '0') : "F" + Eval("RNum").ToString().PadLeft(8, '0')%>
                        </td>
                    <td class="RecordItem"     style="  text-align:center; width:70px;">
                          <%#Convert.ToDateTime(Eval("Createdate")).ToString("yyyy-MM-dd")%>
                        </td>
                     <td class="RecordItem" style="text-align:center;  ">
                            <%#(int)Eval("Financetype") == 1 ? "现金" : "银行"%></b>
                        </td>
                          <td class="RecordItem" style="text-align:center; width:280px; ">
                           <%#Eval("Remark")%></b> </td>
                        <td class="RecordItem" style="text-align:center; ">
                          <%#Eval("Name")%></b>
                       </td>
                            <td class="RecordItem" style="text-align:center;  ">
                            &nbsp;<%#Eval("Name2")%></b>
                        </td>
                         <td class="RecordItem" style="text-align:center;  ">
                            &nbsp;<span style="color:Blue; "><%#Convert.ToDouble(Eval("is_shou")).ToString("#,##0.00")%></span>
                        </td>
                            <td class="RecordItem" style="text-align:center; ">
                            &nbsp;<span  style=" color:#cd0000;"><%#Convert.ToDouble(Eval("Is_zhi")).ToString("#,##0.00")%></span>
                        </td> 
                          </td>
                            <td class="RecordItem" style="text-align:center; ">
                            &nbsp;
                             <%#Eval("balance").ToString().IndexOf("-") == 0 ? "<span style=\"color:#000;\">" + Convert.ToDouble(Eval("balance")).ToString("#,##0.00") + "</span>" : "<span style=\"color:#000;\">" + Convert.ToDouble(Eval("balance")).ToString("#,##0.00") + "</span>"%>
                        </td>   
                         <td class="RecordItem" style="text-align:center; ">
                            &nbsp;<%#Eval("do_name")%>
                        </td>  
                         <td class="RecordItem" style="text-align:center; ">
                            &nbsp;<%#Eval("Last_do").ToString() == "" ? Eval("do_name").ToString() :"<span style=\"color:#cd0000;\">"+ Eval("Last_do").ToString()+"</span>"%>
                        </td>  
                         <td class="RecordItem" style="text-align:center; ">
                           
                             &nbsp;<%#Eval("Employ_do").ToString()!= "" ? Eval("Employ_do").ToString() : "受款人"%>
                        </td>  
                        <td class="RecordItemRight"  style=" text-align:center; font-size:12px;" >
            <a class="Link" style=" font-size:12px;" href="admin_Finan_UpdateT.aspx?id=<%#Eval("id")%>">修改</a>
<asp:LinkButton runat="server"  ID="lkb"  CommandArgument='<%#Eval("id")%>' CommandName="del" Text="删除" OnClientClick= "return   confirm( '您确认删除该记录吗? '); " style=" font-size:12px;" ></asp:LinkButton>
<a class="Link" href="admin_printjz.aspx?url=<%#Eval("Id")%>"  target="_blank" style=" font-size:12px;">打印</a>

                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
       
            <tr>
                <td class="Pager" colspan="14" style="padding-right: 10px; text-align:center;">
                    <cc1:MyPageBar ID="MyPageBar1" runat="server" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

